Skip to content

feat(2403): wire up learn page#2446

Open
ycanales wants to merge 16 commits into
developfrom
cy/2403-learn-page
Open

feat(2403): wire up learn page#2446
ycanales wants to merge 16 commits into
developfrom
cy/2403-learn-page

Conversation

@ycanales
Copy link
Copy Markdown
Collaborator

@ycanales ycanales commented May 16, 2026

Issue: #2403

Summary & Context

Changes

  • Uses get_latest_post_cards
  • Adds Category.short_description: field, migration and Waftail snippet.
  • Randomised category-card builder in LearnPageView
  • Link it to the "Learn" in navbar.

‼️ Risks & Considerations ‼️

  • The "Libraries categories" carousel stepper buttons don't work without JS. The approach taken with the Testimonials component wouldn't work here, as it only works cause it shows one item at a time, no scrolling supported. Since you can just scroll, I would hide the stepper buttons if JS is not available.
  • Implement Entry-Library relationship for library tags?
image image image

Screenshots

learn

Self-review Checklist

  • Tag at least one team member from each team to review this PR
  • Link this PR to the related GitHub Project ticket

Frontend

  • UI implementation matches Figma design
  • Tested in light and dark mode
  • Responsive / mobile verified
  • Accessibility checked (keyboard navigation, etc.)
  • Ensure design tokens are used for colors, spacing, typography, etc. – No hardcoded values
  • Test without JavaScript (if applicable)
  • No console errors or warnings

@ycanales ycanales requested review from herzog0 and jlchilders11 May 18, 2026 17:20
@ycanales ycanales linked an issue May 18, 2026 that may be closed by this pull request
Copy link
Copy Markdown
Collaborator

@herzog0 herzog0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey Cristian, all good from my end, just a couple of comments that you should be aware of!

Comment thread core/views.py
kwargs={
"version_slug": LATEST_RELEASE_URL_PATH_STR,
"library_view_str": "categorized",
"category_slug": category.slug,
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this is doing anything currently. We should probably create a follow-up ticket to wire this up correctly to what @julhoang did in her pr #2420

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If @julhoang's PR merges first I could adjust it here, or in a follow-up ticket, whatever's best 👍

<div class="item-a">
{% with data=post_cards_data %}
{% include 'v3/includes/_post_cards_v3.html' with heading=data.heading posts=data.posts view_all_url=data.view_all_url view_all_label=data.view_all_label theme='teal' variant="content-card" %}
{% include 'v3/includes/_post_card.html' with heading=data.heading items=data.posts variant="card" theme="teal" layout="vertical" primary_cta_label=data.view_all_label primary_cta_url=data.view_all_url %}
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a heads up that this will conflict with @jlchilders11's pr #2414.
In his PR he also fixes the designs of the boost community card, so QA must be aware that you're tackling this in your PR, if it moves to QA before Jeremy's one gets merged.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the heads up, I noticed so I'm counting on it merging first and me rebasing over the last changes 👍

jlchilders11 and others added 11 commits May 20, 2026 16:11
Adopts the _community_card.html component from PR #2414 for the
'Boost community' section of the Learn page (replacing _join_card.html),
along with its supporting CSS rewrite (learn-page.css cleanup, new
community-card.css) and the registration in components.css. Renames
boost_community_data item 'url' -> 'cta_url' to match the new
component's expected shape.
@ycanales ycanales requested review from julhoang and julioest May 21, 2026 13:43
Copy link
Copy Markdown
Collaborator

@julhoang julhoang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @ycanales ! Thank you for setting up the shared helper for querying the latest posts, and I love the handy Wagtail snippet for the categories too! Definitely makes it much easier to manage that content than clicking through that the admin panel – speaking of which, would you mind raising to Glauber & Rob that we need content support to populate the new description of the categories?

Comment thread core/views.py
Comment on lines 510 to 565
ctx["learn_card_data"] = [
{
"title": "I want to learn:",
"text": "How to install Boost, use its libraries, build projects, and get help when you need it.",
"text": (
"How to install Boost, use its libraries, build projects, "
"and get help when you need it."
),
"links": [
{
"label": "Explore common use cases",
"url": "https://www.example.com",
"url": "https://www.boost.org/doc/user-guide/common-introduction.html",
},
{
"label": "Build with CMake",
"url": "https://www.boost.org/doc/user-guide/building-with-cmake.html",
},
{
"label": "Visit the FAQ",
"url": "https://www.boost.org/doc/user-guide/faq.html",
},
{"label": "Build with CMake", "url": "https://www.example.com"},
{"label": "Visit the FAQ", "url": "https://www.example.com"},
],
"url": "https://www.example.com",
"label": "Learn more about Boost",
"url": "https://www.boost.org/doc/user-guide/getting-started.html",
"label": "Get started with Boost",
"image_src": large_static("/img/v3/learn-page/learn-cheetah.png"),
"mobile_image_src": large_static(
"/img/v3/learn-page/cheetah-mobile.png"
),
},
{
"title": "I want to learn:",
"text": "How to install Boost, use its libraries, build projects, and get help when you need it.",
"title": "I want to contribute:",
"text": (
"How to contribute to Boost, propose new libraries, "
"and engage in formal reviews."
),
"links": [
{
"label": "Explore common use cases",
"url": "https://www.example.com",
"label": "Contribute to an existing library",
"url": "https://www.boost.org/doc/contributor-guide/contributors-faq.html",
},
{
"label": "Learn about formal reviews",
"url": "https://www.boost.org/doc/formal-reviews/submissions.html",
},
{
"label": "Visit the Contributors FAQ",
"url": "https://www.boost.org/doc/contributor-guide/contributors-faq.html",
},
{"label": "Build with CMake", "url": "https://www.example.com"},
{"label": "Visit the FAQ", "url": "https://www.example.com"},
],
"url": "https://www.example.com",
"label": "Learn more about Boost",
"image_src": large_static("img/v3/learn-page/learn-octopus.png"),
"url": "https://www.boost.org/doc/contributor-guide/requirements/library-requirements.html",
"label": "Propose a new library",
"image_src": large_static("/img/v3/learn-page/learn-octopus.png"),
"mobile_image_src": large_static(
"/img/v3/learn-page/octopus-mobile.png"
),
},
]
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All of these data are static – can we consider having the page HTML template hardcode these instead of serving these through context? 🤔 I think it'd be better to have the BE just provide dynamic data. Please consider updating the other ctx as well (e.g. ctx["why_boost_cards"], ctx["info_card"], ctx["boost_community_data"] , etc)

Comment thread core/views.py
Comment on lines +569 to +570
# Copy mirrors the Figma frame at node 1849:49695. The design currently
# has two cards titled "Modern approach to C++" — flagged to design.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we follow up with design and remove this comment from code? 🙏

Comment thread news/services.py
Comment on lines +33 to +35
Entry.objects.published()
.select_related("author")
.order_by("-publish_at")[:limit]
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would you mind adding .filter(deleted_at__isnull=True) here to filter out non-deleted post here?

Comment thread core/views.py
Comment on lines +655 to +657
Category.objects.annotate(library_count=Count("libraries", distinct=True))
.filter(library_count__gt=0)
.only("name", "slug", "short_description")
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we filter out category where name = null here too? I've just noticed there are a few libraries that are not categorized!

Image

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch! Adjusted.

Comment thread news/services.py Outdated
author.get_avatar_url() if hasattr(author, "get_avatar_url") else ""
),
"badge_url": None,
"show_badge": False,
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm it seems like this show_badge isn't used anywhere and we probably don't need it at all – 🪓?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Totally right, adjusted, thanks!

Comment thread templates/v3/learn_page.html Outdated
<div class="item-b">
{% with data=boost_community_data %}
{% include 'v3/includes/_community_card.html' with heading=data.heading items=data.posts primary_cta_url=data.view_all_url primary_cta_label=data.view_all_label %}
{% include 'v3/includes/_community_card.html' with heading=data.heading items=data.items variant="card" theme="default" layout="vertical" primary_cta_label=data.primary_cta_label primary_cta_url=data.primary_cta_url %}
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This variant should be list and we can remove the theme and layout

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch, I've fixed it, thanks!

Comment thread core/views.py Outdated
Comment on lines +517 to +531
"links": [
{
"label": "Explore common use cases",
"url": "https://www.example.com",
"url": "https://www.boost.org/doc/user-guide/common-introduction.html",
},
{
"label": "Build with CMake",
"url": "https://www.boost.org/doc/user-guide/building-with-cmake.html",
},
{
"label": "Visit the FAQ",
"url": "https://www.boost.org/doc/user-guide/faq.html",
},
{"label": "Build with CMake", "url": "https://www.example.com"},
{"label": "Visit the FAQ", "url": "https://www.example.com"},
],
"url": "https://www.example.com",
"label": "Learn more about Boost",
"url": "https://www.boost.org/doc/user-guide/getting-started.html",
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For these internal URLs, can we make these relative paths instead of hardcoded boost.org? Please update the other URLs on this page as well 🙏

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch, adjusted!

Comment on lines +8 to +21
class CategorySnippetViewSet(SnippetViewSet):
model = Category
menu_label = "Library Categories"
icon = "tag"
list_display = ["name", "short_description"]
search_fields = ["name", "short_description"]
panels = [
FieldPanel("name"),
FieldPanel("slug"),
FieldPanel("short_description"),
]


register_snippet(CategorySnippetViewSet)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very neat!!

Copy link
Copy Markdown
Collaborator

@jlchilders11 jlchilders11 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a general comment: This is built with the assumption that we are using Entry models, per our earlier discussion could we stub out logic for handling wagtail pages as well?

icon = "tag"
list_display = ["name", "short_description"]
search_fields = ["name", "short_description"]
panels = [
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a note when defining panels, if you are using a FieldPanel with no customization you can also just enter the field name as a string and Wagtail will figure it out.

So you could instead have

panels = [
    "name",
    "slug",
    "short_description"
]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Webpage Integration: Learn

5 participants